<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>总进球</title>
    <script src="../static/js/jquery-3.7.1.min.js" type="text/javascript"></script>
    <style>
    table {
        border-collapse: collapse; /*合并边框*/
        width: 100%; /*设置表格宽度*/
    }

    th, td {
        border: 1px solid black; /*设置边框线样式、颜色和大小*/
        padding: 8px; /*设置内边距*/
    }
        .p1{
                background-color: red;
        }
        .p2{
            background-color: magenta;
        }
        .p3{
            background-color: green;
        }
        .p4{
            background-color: mediumturquoise;
        }
        .p5{
            background-color: orange;
        }
        .p6{
            background-color: royalblue;
        }
        .p7{
            background-color: palevioletred;
        }.p8{
            background-color: brown;
        }
        .peid{
            background-color: gray;
        }
        .qiu{
            background-color: darkcyan;
        }
</style>

</head>
<body>
<table id="t">
<thead>
<tr>
    <td>开赛时间</td>
    <td>比赛</td>
    <td>场次</td>
    <td class='peid'>一赔</td>
    <td class='peid'>二赔</td>
    <td class='peid'>三赔</td>
    <td class='peid'>四赔</td>
    <td class='peid'>五赔</td>
    <td class='peid'>六赔</td>
    <td class='peid'>七赔</td>
    <td class='peid'>八赔</td>
    <td class="qiu">0球</td>
    <td class="qiu">1球</td>
    <td class="qiu">2球</td>
    <td class="qiu">3球</td>
    <td class="qiu">4球</td>
    <td class="qiu">5球</td>
    <td class="qiu">6球</td>
    <td class="qiu">7+球</td>
    <td>推荐</td>
    <td>操作</td>
</tr>
</thead>
</table>
</body>

<script type="text/javascript">
            // 获取后台数据
            $.get('/getselling_ttg', function(res) {
                var arr = new Array();
                var total = res.length; //总

                for(var i=0;i<total;i++) {
                    arr.push("<tr>");
                    arr.push("<td colspan='20'>");arr.push("竞猜日期:"+res[i].businessDate);arr.push("</td>");
                    arr.push("</tr>");
                    for (var j = 0; j < res[i].datas.length; j++) {
                        var d = res[i].datas[j];

                        var qius = d.qius;
                        var peis = d.peid;

                        arr.push("<tr>");
                        arr.push("<td>");arr.push(d.matchDate);arr.push(d.matchTime);arr.push("</td>");
                        arr.push("<td>");arr.push(d.homeTeamAbbName+"vs"+d.awayTeamAbbName);arr.push("</td>");
                        arr.push("<td>");arr.push(d.NO);arr.push("</td>");

                        for (var a = 0; a < peis.length; a++) {
                            //按赔来显示
                            arr.push("<td>");
                            arr.push(peis[a][0].split("")[1]+"球");
                            arr.push("</td>");
                        }
                        for (var a = 0; a < qius.length; a++) {
                            //按球来显示
                            arr.push("<td>");
                            arr.push(qius[a]);
                            arr.push("</td>");
                        }

                        arr.push("<td>");arr.push(" ");arr.push("</td>");
                        var detail = "<a href='/ttg?tp=selling&matchId="+d.matchId+"' target=\"_blank\">"+d.NO+"  同赔</a>";
                        arr.push("<td>");arr.push(detail);arr.push("</td>");
                        arr.push("</tr>");
                    }
                }
                $("#t").append(arr.join(" "))
                });
</script>
</html>